#!/usr/bin/env bash

#systemctl restart mariadb.service


#show grants for canal
#show processlist

wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
rpm -ivh mysql57-community-release-el7-7.noarch.rpm
mv mysql57-community-release-el7-7.noarch.rpm /opt/tmp
yum -y install mysql-server

pass=$(cat   /var/log/mysqld.log | grep root@localhost: | awk -F "root@localhost: " '{print $2}')
echo $pass
mysql -u root -p
# @Aa49810712@
##!/bin/bash
#
#pass=$(cat   /var/log/mysqld.log | grep root@localhost: | awk -F "root@localhost: " '{print $2}')
#
#/usr/bin/expect <<-EOF
#spawn mysql -uroot -p
#expect {
#        "Enter password:" { send "$pass\r";exp_continue }
#        "":  { exp_send "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456')\r;"}
#}
#
#interact
#expect eof
#EOF


